Kapitel 3: Korpus¶

Das Notebook ergänzt Kapitel 3 'Korpus'.

Import¶

In [1]:
import pandas as pd
import numpy as np
import plotly.express as px
from tqdm.notebook import *
In [2]:
from resources_geschichtslyrik import *
from resources_statistics import *
In [3]:
meta = pd.read_json(r"../resources/meta.json")

Kröncke 2024 vs. Häntzschel 1991¶

[Häntzschel 1991] = Günter Häntzschel (Hg.): Bibliographie der deutschsprachigen Lyrikanthologien 1840–1914, 2 Bde., München u. a. 1991.

In [4]:
anth_kroencke = meta.query("corpus == 'anth' & 1840 <= anthology_year_first_ed <= 1914")['anthology'].unique()
anth_kroencke_and_haentzschel = [
    '1840.Schottmüller', 
    '1846.Kletke',
    '1850.Grube',
    '1850.Kriebitzsch',
    '1851.Müller/Kletke',
    '1852.Böttger.4(1862)',
    '1852.Kurz',
    '1855.Zimmermann',
    '1862.Fricke',
    '1865.Anonym',
    '1867.Remy',
    '1867.Scholz',
    '1872.Bindewald.2(1875)',
    '1876.Bintz',
    '1878.Krämer',
    '1879.Haselmayer/Haselmayer',
    '1879.Teuffenbach',
    '1881.Polack',
    '1881/83.Meyer',
    '1884.Boehm',
    '1884.Meyer/Reichel',
    '1887.Kriebitzsch',
    '1889.Krais',
    '1890.Basedow',
    '1890.Kirchner',
    '1891.Brümmer',
    '1892.Dietlein',
    '1892/93.Tetzner',
    '1899.Schiffels',
    '1906/07.Weber',
    '1907.Zettel/Brunner',
    '1908.Berg',
    '1912.Werner'
]
and_kroencke_but_not_haentzschel = [x for x in anth_kroencke if x not in anth_kroencke_and_haentzschel]
In [5]:
print(f"Anthologien 1840–1914 in Kröncke 2024  : {len(anth_kroencke)}")
print(f"... davon auch  in Häntzschel 1991     : {len(anth_kroencke_and_haentzschel)}")
print(f"... davon nicht in Häntzschel 1991     : {len(and_kroencke_but_not_haentzschel)}")
Anthologien 1840–1914 in Kröncke 2024  : 68
... davon auch  in Häntzschel 1991     : 33
... davon nicht in Häntzschel 1991     : 35

Gesamtzahl Anthologien¶

In [6]:
anth_count = meta.query("corpus=='anth'")['anthology'].nunique()

print(f"Anthologien insgesamt  : {anth_count}")
Anthologien insgesamt  : 97

Anthologien im Zeitverlauf¶

In [7]:
plot_data = (meta
    .query("corpus=='anth'")
    .drop_duplicates(subset='anthology')
)

plot_data['anthology_decade'] = (plot_data['anthology_year_first_ed']//10)*10

plot_data = plot_data.groupby('anthology_decade').size()
for x in [1800, 1810, 1990]:
    if x not in plot_data.index:
        plot_data[x] = 0
plot_data.index = [str(x)+'er' for x in plot_data.index]
In [8]:
fig = px.bar(
    plot_data.sort_index(),
    labels = {'value' : 'Anzahl Geschichtslyrik-Anthologien', 'index' : ''},
)

fig.update_layout(
    width=900, height=500,
    showlegend = False,
    xaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    yaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
)
fig = update_fig_for_publication(fig, make_grey=True)
fig.write_image(f"plots/3 Häufigkeit von Geschichtslyrik-Anthologien im Zeitverlauf.pdf")
fig.show()

Texte in allen Anthologien¶

In [9]:
meta_all = meta.query("corpus=='anth'")
In [10]:
print(f"Anthologien            : {meta_all['anthology'].nunique()}")
print(f"Texte (mit Dubletten)  : {meta_all.shape[0]}")
print(f"Texte (ohne Dubletten) : {meta_all.drop_duplicates(subset='author_title').shape[0]}")
print(f"Autor:innen            : {meta_all['author'].nunique()}")
Anthologien            : 97
Texte (mit Dubletten)  : 20833
Texte (ohne Dubletten) : 9990
Autor:innen            : 2253

Texte in digitalisierten Anthologien¶

In [11]:
meta_digitized = meta.query("corpus=='anth' and digitized")
In [12]:
print(f"Anthologien            : {meta_digitized['anthology'].nunique()}")
print(f"Texte (mit Dubletten)  : {meta_digitized.shape[0]}")
print(f"Texte (ohne Dubletten) : {meta_digitized.drop_duplicates(subset='author_title').shape[0]}")
print(f"Autor:innen            : {meta_digitized['author'].nunique()}")
Anthologien            : 57
Texte (mit Dubletten)  : 12553
Texte (ohne Dubletten) : 6141
Autor:innen            : 1665

Texte von 1850 bis 1918 in allen Anthologien¶

In [13]:
meta_18501918 = meta.query("corpus=='anth' and 1850 <= year <= 1918")
In [14]:
print(f"Anthologien            : {meta_18501918['anthology'].nunique()}")
print(f"Texte (mit Dubletten)  : {meta_18501918.shape[0]}")
print(f"Texte (ohne Dubletten) : {meta_18501918.drop_duplicates(subset='author_title').shape[0]}")
print(f"Autor:innen            : {meta_18501918['author'].nunique()}")
Anthologien            : 84
Texte (mit Dubletten)  : 5544
Texte (ohne Dubletten) : 2915
Autor:innen            : 725

Geschichtslyrische Texte von 1850 bis 1918 in allen Anthologien¶

In [15]:
meta_18501918gesch = meta.query("corpus=='anth' and 1850 <= year <= 1918 and geschichtslyrik==1")
In [16]:
print(f"Anthologien            : {meta_18501918gesch['anthology'].nunique()}")
print(f"Texte (mit Dubletten)  : {meta_18501918gesch.shape[0]}")
print(f"Texte (ohne Dubletten) : {meta_18501918gesch.drop_duplicates(subset='author_title').shape[0]}")
print(f"Autor:innen            : {meta_18501918gesch['author'].nunique()}")
Anthologien            : 83
Texte (mit Dubletten)  : 3676
Texte (ohne Dubletten) : 1850
Autor:innen            : 528

Anthologiekorpus¶

In [17]:
def get_corpus_info(meta):
    info = pd.DataFrame(columns=['Anzahl'])
    
    info.loc['Texte'] = meta.shape[0]
    info.loc['Digitalisierte Texte'] = meta.query('text_bestocr.notna()').shape[0]
    info.loc['Manuell datierte Texte'] = meta.query('year_gt.notna()').shape[0]
    info.loc['Autor:innen'] = meta['author'].nunique()
    info.loc['Männliche Autor:innen'] = meta.query("author_gnd_gender == 'male'")['author'].nunique()
    info.loc['Texte von männlichen Autor:innen'] = meta.query("author_gnd_gender == 'male'")['author'].shape[0]
    info.loc['Weibliche Autor:innen'] = meta.query("author_gnd_gender == 'female'")['author'].nunique()
    info.loc['Texte von weiblichen Autor:innen'] = meta.query("author_gnd_gender == 'female'")['author'].shape[0]
     
    return info
In [18]:
meta_anth = (
    meta
    .query("corpus=='anth'")
    .query("1850 <= year <= 1918")
    .query("geschichtslyrik == 1")
    .drop_duplicates(subset='author_title')
)
In [19]:
get_corpus_info(meta_anth)
Out[19]:
Anzahl
Texte 1850
Digitalisierte Texte 1723
Manuell datierte Texte 1432
Autor:innen 528
Männliche Autor:innen 432
Texte von männlichen Autor:innen 1658
Weibliche Autor:innen 28
Texte von weiblichen Autor:innen 64
In [20]:
top_authors_18501889 = (
    meta_anth
    .query("1850 <= year <= 1889")
    .groupby('author').size()
    .sort_values(ascending = False)
)

top_authors_18501889.head(20)
Out[20]:
author
Lingg, Hermann                       76
Dahn, Felix                          58
Möser, Albert                        53
Meyer, Conrad Ferdinand              49
Gruppe, Otto Friedrich               42
Gerok, Karl                          36
Fontane, Theodor                     24
Müller von Königswinter, Wolfgang    23
Hesekiel, George                     22
Greif, Martin                        22
Vierordt, Heinrich                   21
Sturm, Julius                        20
Geibel, Emanuel                      18
Schack, Adolf Friedrich Graf von     18
Stieler, Karl                        17
Böttger, Adolf                       15
Krais, Julius                        14
Weilen, Josef von                    13
Liliencron, Detlev von               13
Scheffel, Joseph Viktor von          13
dtype: int64
In [21]:
top_authors_18901918 = (
    meta_anth
    .query("1890 <= year <= 1918")
    .groupby('author').size()
    .sort_values(ascending = False)
)

top_authors_18901918.head(20)
Out[21]:
author
Münchhausen, Börries von       17
Lissauer, Ernst                15
Gaudy, Alice von               11
Geißler, Max                   11
Wickenburg, Albrecht von       11
Schrutz, Demetrius             10
Vierordt, Heinrich             10
Miegel, Agnes                   9
Strauß und Torney, Lulu von     7
Löns, Hermann                   7
Weber, Ernst                    7
Schüler, Gustav                 7
Möser, Albert                   6
Blunck, Hans Friedrich          6
Lienert, Meinrad                6
Greif, Martin                   6
Avenarius, Ferdinand            6
Hohlbaum, Robert                6
Frey, Adolf                     5
Kunad, Paul                     5
dtype: int64

Anthologiekorpus – Zeitverlauf¶

In [22]:
fig = px.bar(
    meta_anth['year'].value_counts(),
    labels = {'value' : 'Anzahl Texte', 'index' : ''},
    # color_discrete_sequence=["grey"]
)

fig.update_layout(
    width = 1000, height = 500,
    showlegend = False,
    xaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    yaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    xaxis_range = [1842,1929]
)
fig = update_fig_for_publication(fig, make_grey=True)
fig.write_image(f"plots/3 Verteilung der Texte im Anthologiekorpus nach Jahren.pdf")
fig.show()
In [23]:
plot_data = meta_anth['decade'].value_counts()
for x in [1840, 1920]:
    if x not in plot_data.index:
        plot_data[float(x)] = 0
plot_data.index = [str(int(x))+'er' for x in plot_data.index]

fig = px.bar(
    plot_data.sort_index(),
    labels = {'value' : 'Anzahl Texte', 'index' : ''},
    # color_discrete_sequence=["grey"]
)

fig.update_layout(
    width = 1000, height = 500,
    showlegend = False,
    xaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    yaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
)
fig = update_fig_for_publication(fig, make_grey=True)
fig.write_image(f"plots/3 Verteilung der Texte im Anthologiekorpus nach Jahrzehnten.pdf")
fig.show()
In [24]:
print(f"Texte ab 1890 : {meta_anth.query('year >= 1890').shape[0]}")
Texte ab 1890 : 393
In [25]:
teil_des_korpus = []
for this_author_title in meta['author_title']:
    if this_author_title in meta_anth['author_title'].tolist():
        teil_des_korpus.append('Ja')
    else:
        teil_des_korpus.append('Nein')
meta['Teil des Korpus'] = teil_des_korpus

fig = px.scatter(
    meta.query("corpus == 'anth' and year >= 1800"),
    x = 'year',
    y = 'anthology_year_used_ed',
    color = 'Teil des Korpus',
    labels = {'year' : 'Datierung Text<br>', 'anthology_year_used_ed' : '<br>Datierung Anthologie'},
    hover_data = ['anthology', 'author', 'title']
)

fig.update_layout(
    height = 700,
    yaxis_range=[1790,1990],
    xaxis_range=[1790,1990],
    xaxis=dict(tickfont=dict(size=18), titlefont=dict(size=18)),
    yaxis=dict(tickfont=dict(size=18), titlefont=dict(size=18)),
    legend=dict(font = dict(size = 16)),
)
fig.update_traces(marker=dict(size=12))
fig.show()

Anthologiekorpus ohne Anthologien nach 1918/1945¶

In [26]:
meta_anth_1918 = (
    meta
    .query("anthology_year_first_ed <= 1918")
    .query("corpus=='anth'")
    .query("1850 <= year <= 1918")
    .query("geschichtslyrik == 1")
    .drop_duplicates(subset='author_title')
)

meta_anth_1945 = (
    meta
    .query("anthology_year_first_ed <= 1945")
    .query("corpus=='anth'")
    .query("1850 <= year <= 1918")
    .query("geschichtslyrik == 1")
    .drop_duplicates(subset='author_title')
)
In [27]:
print(f"Texte ab 1900 inkl. alle Anthologien      : {meta_anth.query('1900<=year<=1918').shape[0]}")
print(f"Texte ab 1900 exkl. Anthologien nach 1918 : {meta_anth_1918.query('1900<=year<=1918').shape[0]}")
print(f"Texte ab 1900 exkl. Anthologien nach 1945 : {meta_anth_1945.query('1900<=year<=1918').shape[0]}")
Texte ab 1900 inkl. alle Anthologien      : 240
Texte ab 1900 exkl. Anthologien nach 1918 : 117
Texte ab 1900 exkl. Anthologien nach 1945 : 236
In [28]:
print(f"Texte bis 1899 inkl. alle Anthologien      : {meta_anth.query('1850<=year<=1899').shape[0]}")
print(f"Texte bis 1899 exkl. Anthologien nach 1945 : {meta_anth_1945.query('1850<=year<=1899').shape[0]}")
Texte bis 1899 inkl. alle Anthologien      : 1610
Texte bis 1899 exkl. Anthologien nach 1945 : 1591
In [29]:
texts_all = meta_anth.query('1900<=year<= 1918')['author_title'].tolist()
texts_until_1945 = meta_anth_1945.query('1900<=year<= 1918')['author_title'].tolist()
texts_only_after_1945 = [x for x in texts_all if x not in texts_until_1945]

print(f"Texte ab 1900 ausschließlich in Anthologien nach 1945:\n")

for text in texts_only_after_1945:
    print(text)
Texte ab 1900 ausschließlich in Anthologien nach 1945:

Busse, Karl – Gruß an die verlorene Heimat
Heym, Georg – Columbus
Manteuffel, Peter Zoege von – Biron und Münnich
Heym, Georg – Bastille

Vergleich: Autor:in in Antholgien vs. Autor:in außerhalb Anthologien¶

In [30]:
author_name = 'Münchhausen, Börries von'
In [31]:
bin_comp_features = [
    'geschichtslyrik', # 01
    'empirisch', #02,
    'theoretisch', #03
    'ballade', #04
    'sonett', #04
    'lied', #04
    'rollengedicht', #04
    'denkmal', #04
    'nogenre', #04
    'sprechinstanz_markiert', #05
    'sprechinstanz_nicht_in_vergangenheit', #06
    'sprechinstanz_in_vergangenheit', #06
    'sprechakt_erzaehlen_vorhanden', #07
    'sprechakt_beschreiben_vorhanden', #07
    'sprechakt_behaupten_vorhanden', #07
    'sprechakt_auffordern_vorhanden', #07
    'sprechakt_fragen_vorhanden', #07
    'praesens_vorhanden', #08
    'praeteritum_vorhanden', #08
    'praesens_praeteritum_vorhanden', #08
    'futur_vorhanden', #08
    'in_hohem_mass_konkret', #09
    'wissen_identisch', #10
    'unwissend', #10
    'wissend', #10
    'gegenwartsdominant', #11
    'fixierbarkeit', #13
    'antike', #15,
    'mittelalter', #15
    'neuzeit', #15
    'anachronismus', # 16
    'gegenwartsbezug', #17
    'behandelt_deutschen_mittelraum', #19
    'behandelt_aussereuropa', #20
    'ereignis', #21
    'zustand', #21
    'krieg', #22
    'politik', #22
    'religion', #22
    'tod', #22
    'liebe', #22
    'nation_volk_d', #22
    # 'krieg_positiv', #23 nicht genug Daten
    # 'krieg_negativ', #23 nicht genug Daten
    # 'politik_positiv', #23 nicht genug Daten
    # 'politik_negativ', #23 nicht genug Daten
    # 'religion_positiv', #23 nicht genug Daten
    # 'religion_negativ', #23 nicht genug Daten
    # 'tod_positiv', #23 nicht genug Daten
    # 'tod_negativ', #23 nicht genug Daten
    # 'liebe_positiv', #23 nicht genug Daten
    # 'liebe_negativ', #23 nicht genug Daten
    # 'nation_volk_d_positiv', #23 nicht genug Daten
    # 'nation_volk_d_negativ', #23 nicht genug Daten
    'nationalismus', #26
    'heroismus', #27
    'religiositaet', #28
    'persmarker_vorhanden', #29
    'zeitmarker_vorhanden', #30
    'ortmarker_vorhanden', #31
    'objektmarker_vorhanden', #32
    'ueberlieferung', #33
    # 'ueberlieferung_positiv', #34 nicht genug Daten
    # 'ueberlieferung_negativ', #35 nicht genug Daten
    'geschichtsauffassung', #36
    # 'geschichtsauffassung_positiv', #37 nicht genug Daten
    # 'geschichtsauffassung_negativ', #37 nicht genug Daten
    'reim', #38
    'metrum', #39
    'verfremdung', #40
]
In [32]:
cont_comp_features = [
    'words',
    'sprechakte_count', #07
    'zeitebenen', #12
    'beginn', #14
    'ende', #15
    'zeit_mitte', #15
    'kleinraum_count', #18
    'mittelraum_count', #19
    'entity_count', #24
    'bekanntes_individuum_count', #24
    'unbekanntes_individuum_count', #24
    'kollektiv_count', #24
    'nichtmensch_count', #24
    'bekanntes_individuum_positiv', #25
    'bekanntes_individuum_negativ', #26
    'marker_count', #29
]
In [33]:
def get_meta_author (meta, author_name):
    meta_author = (
        meta
        .query("geschichtslyrik == 1")
        .query("1850 <= year <= 1918")
        .query("author == @author_name")
    ).copy()

    meta_author = binarize_meta(meta_author)

    # etwaige Texte der Autor:in, die bereits in 'anth' sind, aus 'add' entfernen
    meta_author_anth_titles = meta_author.query("corpus == 'anth'")['author_title'].unique()
    drop_index = meta_author.query("corpus == 'add' and author_title.isin(@meta_author_anth_titles)").index
    meta_author = meta_author.drop(drop_index)

    # Dubletten entfernen
    meta_author = meta_author.drop_duplicates(subset = 'author_title')

    # Korpuszugehörigkeit mit 1 = 'Anthologiekorpus' und 0 = 'nicht Anthologiekorpus' kodieren
    meta_author['corpus_int'] = [1 if x == 'anth' else 0 for x in meta_author['corpus']]
    
    return meta_author

meta_author = get_meta_author(meta, author_name)
In [34]:
print(f"Texte von [{author_name}] im        Anthologiekorpus : {meta_author['corpus_int'].value_counts().loc[1]}")
print(f"Texte von [{author_name}] außerhalb Anthologiekorpus : {meta_author['corpus_int'].value_counts().loc[0]}")
Texte von [Münchhausen, Börries von] im        Anthologiekorpus : 17
Texte von [Münchhausen, Börries von] außerhalb Anthologiekorpus : 77
In [35]:
results = relations_binbin(
    meta = meta_author, 
    main_feature = 'corpus_int',
    comp_features = bin_comp_features,
)

Ergebnisse¶

In [36]:
# Überrepräsentiert im Anthologiekorpus
round(results.sort_values(by = 'diff', ascending = False), 2).head(5)
Out[36]:
wenn_nicht wenn_nicht_detail wenn_ja wenn_ja_detail diff_low_bootstrap diff_low diff diff_high diff_high_bootstrap chi2 chi2_p fisher_p phi min_real min_expected
krieg 0.31 24/77 0.71 12/17 0.15 0.15 0.39 0.63 0.64 9.16 0.00 0.00 0.31 5.0 6.51
religiositaet 0.00 0/77 0.18 3/17 0.00 -0.00 0.18 0.36 0.35 14.04 0.00 0.01 0.39 0.0 0.54
ortmarker_vorhanden 0.10 8/77 0.24 4/17 -0.08 -0.08 0.13 0.34 0.35 2.16 0.14 0.22 0.15 4.0 2.17
objektmarker_vorhanden 0.64 49/77 0.76 13/17 -0.13 -0.10 0.13 0.36 0.36 1.02 0.31 0.40 0.10 4.0 5.79
mittelalter 0.29 22/77 0.41 7/17 -0.13 -0.13 0.13 0.38 0.37 1.04 0.31 0.39 0.11 7.0 5.24
In [37]:
# Überrepräsentiert außerhalb Anthologiekorpus
round(results.sort_values(by = 'diff', ascending = True), 2).head(5)
Out[37]:
wenn_nicht wenn_nicht_detail wenn_ja wenn_ja_detail diff_low_bootstrap diff_low diff diff_high diff_high_bootstrap chi2 chi2_p fisher_p phi min_real min_expected
ereignis 0.75 58/77 0.53 9/17 -0.49 -0.48 -0.22 0.03 0.03 3.41 0.06 0.08 0.19 8.0 4.88
in_hohem_mass_konkret 0.91 70/77 0.76 13/17 -0.37 -0.36 -0.14 0.07 0.06 2.81 0.09 0.11 0.17 4.0 1.99
ballade 0.55 42/77 0.41 7/17 -0.40 -0.39 -0.13 0.13 0.12 1.00 0.32 0.42 0.10 7.0 8.14
liebe 0.13 10/77 0.00 0/17 -0.21 -0.20 -0.13 -0.05 -0.06 2.47 0.12 0.20 0.16 0.0 1.81
neuzeit 0.65 50/77 0.53 9/17 -0.39 -0.38 -0.12 0.14 0.14 0.86 0.35 0.41 0.10 8.0 6.33
In [38]:
meta_plot = results.copy()
meta_plot['Unterschied'] = ['signifikant' if x < 0.05 else 'nicht signifikant' for x in results['fisher_p']]
meta_plot['diff_abs'] = abs(meta_plot['diff'])

author_anth_count = meta_author.query("corpus_int == 1").shape[0]
author_add_count = meta_author.query("corpus_int == 0").shape[0]

fig = px.scatter(
    meta_plot,
    x = 'wenn_nicht',
    y = 'wenn_ja',
    # color = 'diff_abs',
    hover_data = [meta_plot.index, 'wenn_ja_detail', 'wenn_nicht_detail', 'phi', 'fisher_p'],
    labels = {
        'wenn_ja' : f'im Anthologiekorpus ({author_anth_count} Texte)',
        'wenn_nicht' : f'nicht im Anthologiekorpus ({author_add_count} Texte)',
    },
    color_discrete_sequence=["grey"]
)

fig.update_layout(
    width = 900, height = 500,
    xaxis_range=[-0.1,1.1], 
    yaxis_range=[-0.1,1.1],
    shapes = [{'type': 'line', 'yref': 'paper', 'xref': 'paper', 'y0': 0, 'y1': 1, 'x0': 0, 'x1': 1}],
    xaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    yaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    legend=dict(font = dict(size = 16), traceorder = 'normal'),
)

fig.update_traces(
    marker_size=14,
)
fig = update_fig_for_publication(fig, make_grey=True)
fig.write_image(f"plots/3 Texte innerhalb und außerhalb des Anthologiekorpus (Münchhausen).pdf")
fig.show()
In [39]:
meta_plot = results.copy()
meta_plot['diff_abs'] = abs(meta_plot['diff'])

fig = px.box(
    meta_plot,
    y = 'diff_abs',
    hover_data = [meta_plot.index],
    points = 'all',
    labels = {'diff_abs' : 'Differenz (Prozentpunkte)'}
)

fig.update_layout(
    xaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
    yaxis=dict(tickfont=dict(size=16), titlefont=dict(size=16)),
)

fig.show()
In [40]:
# Absolute Differenz (Autor:in in vs. außerhalb Anthologiekorpus)
print(f"Q1     : {meta_plot['diff_abs'].quantile(0.25)}")
print(f"Median : {meta_plot['diff_abs'].median()}")
print(f"Q3     : {meta_plot['diff_abs'].quantile(0.75)}")
Q1     : 0.022154316271963348
Median : 0.046982429335370494
Q3     : 0.09205500381970973
In [41]:
# Phi Differenz (Autor:in in vs. außerhalb Anthologiekorpus)
print(f"Q1     : {meta_plot['phi'].quantile(0.25)}")
print(f"Median : {meta_plot['phi'].median()}")
print(f"Q3     : {meta_plot['phi'].quantile(0.75)}")
Q1     : 0.025389563029817423
Median : 0.07060498637078785
Q3     : 0.10201915221555019

Vergleichsmaßstab: Ähnlichkeit von Autor:innen innerhalb Anthologiekorpus¶

In [42]:
freq_authors = meta_anth.groupby('author').size().sort_values(ascending = False)
freq_authors = freq_authors.drop(author_name)
freq_authors = freq_authors[freq_authors >= meta_author['corpus_int'].value_counts().min()]
freq_authors = freq_authors[freq_authors <= meta_author['corpus_int'].value_counts().max()]

print(freq_authors)
author
Dahn, Felix                          63
Möser, Albert                        59
Meyer, Conrad Ferdinand              50
Gruppe, Otto Friedrich               42
Gerok, Karl                          36
Vierordt, Heinrich                   31
Greif, Martin                        28
Fontane, Theodor                     26
Müller von Königswinter, Wolfgang    23
Hesekiel, George                     22
Sturm, Julius                        20
Schack, Adolf Friedrich Graf von     18
Geibel, Emanuel                      18
Stieler, Karl                        17
Liliencron, Detlev von               17
dtype: int64
In [43]:
done = []
author_similarity = pd.DataFrame()
meta_anth_bin = binarize_meta(meta_anth)

for author_a in tqdm(freq_authors.index):
    for author_b in freq_authors.index:
        if author_a != author_b and (author_a + author_b) not in done:
            results_add = pd.DataFrame()
            results_add.at[0, 'author_a'] = author_a
            results_add.at[0, 'author_b'] = author_b
            done.append(author_a + author_b)
            done.append(author_b + author_a)
            
            meta_authors = meta_anth_bin.query("author == @author_a or author == @author_b").copy()
            meta_authors['author_id'] = [1 if x == author_a else 0 for x in meta_authors['author']]

            relations_results = relations_binbin(
                meta = meta_authors, 
                main_feature = 'author_id',
                comp_features = bin_comp_features,
            )
            
            relations_results['diff_abs'] = abs(relations_results['diff'])
            results_add.at[0, 'diff_abs_median'] = relations_results['diff_abs'].median()
            results_add.at[0, 'diff_abs_q1'] = relations_results['diff_abs'].quantile(0.25)
            results_add.at[0, 'diff_abs_q3'] = relations_results['diff_abs'].quantile(0.75)
            results_add.at[0, 'phi_median'] = relations_results['phi'].median()
            results_add.at[0, 'phi_q1'] = relations_results['phi'].quantile(0.25)
            results_add.at[0, 'phi_q3'] = relations_results['phi'].quantile(0.75)
            
            author_similarity = pd.concat([author_similarity, results_add])
    
  0%|          | 0/15 [00:00<?, ?it/s]
In [44]:
# Absolute Differenz (Vergleichsautor:in im Anthologiekorpus vs. Vergleichsautor:in im Anthologiekorpus)
print(f"Q1     : {author_similarity['diff_abs_q1'].median()}")
print(f"Median : {author_similarity['diff_abs_median'].median()}")
print(f"Q3     : {author_similarity['diff_abs_q3'].median()}")
Q1     : 0.027777777777777776
Median : 0.08
Q3     : 0.17769607843137253
In [45]:
# Phi (Vergleichsautor:in im Anthologiekorpus vs. Vergleichsautor:in im Anthologiekorpus)
print(f"Q1     : {author_similarity['phi_q1'].median()}")
print(f"Median : {author_similarity['phi_median'].median()}")
print(f"Q3     : {author_similarity['phi_q3'].median()}")
Q1     : 0.04934344919932048
Median : 0.12642903196454136
Q3     : 0.2165819454007326

Fokus Stoffgebiet Militär/Krieg¶

In [46]:
author_names = ['Münchhausen, Börries von', 'Miegel, Agnes', 'Strauß und Torney, Lulu von']
In [47]:
for author_name in author_names:
    meta_author = get_meta_author(meta, author_name)
    
    anth_count = meta_author.query("corpus_int == 1").shape[0]
    anth_krieg_count = meta_author.query("corpus_int == 1 and krieg == 1").shape[0]
    anth_krieg_share = anth_krieg_count/anth_count
    
    add_count = meta_author.query("corpus_int == 0").shape[0]
    add_krieg_count = meta_author.query("corpus_int == 0 and krieg == 1").shape[0]
    add_krieg_share = add_krieg_count/add_count
    
    print(f"{author_name}")
    print(f"innerhalb Anthologiekorpus : {anth_krieg_count}/{anth_count} Militär/Krieg ({anth_krieg_share})")
    print(f"außerhalb Anthologiekorpus : {add_krieg_count}/{add_count} Militär/Krieg ({add_krieg_share})")
    print("\n")
Münchhausen, Börries von
innerhalb Anthologiekorpus : 12/17 Militär/Krieg (0.7058823529411765)
außerhalb Anthologiekorpus : 24/77 Militär/Krieg (0.3116883116883117)


Miegel, Agnes
innerhalb Anthologiekorpus : 5/9 Militär/Krieg (0.5555555555555556)
außerhalb Anthologiekorpus : 1/15 Militär/Krieg (0.06666666666666667)


Strauß und Torney, Lulu von
innerhalb Anthologiekorpus : 5/7 Militär/Krieg (0.7142857142857143)
außerhalb Anthologiekorpus : 2/15 Militär/Krieg (0.13333333333333333)


Kanonisierte Autor:innen im Anthologiekorpus¶

In [48]:
modcanon_authors = ['Hofmannsthal, Hugo von', 'Rilke, Rainer Maria', 'George, Stefan', 'Heym, Georg']
In [49]:
meta_anth.query("author in @modcanon_authors")['author'].value_counts()
Out[49]:
author
Rilke, Rainer Maria    3
George, Stefan         2
Heym, Georg            2
Name: count, dtype: int64

Ergänzungskorpus Kanonisierte Moderne¶

In [50]:
meta_modcanon = (
    meta
    .query("author in @modcanon_authors")
    .query("1850 <= year <= 1918")
    .query("geschichtslyrik == 1")
    .drop_duplicates(subset='author_title')
)
In [51]:
get_corpus_info(meta_modcanon)
Out[51]:
Anzahl
Texte 113
Digitalisierte Texte 113
Manuell datierte Texte 113
Autor:innen 4
Männliche Autor:innen 4
Texte von männlichen Autor:innen 113
Weibliche Autor:innen 0
Texte von weiblichen Autor:innen 0
In [52]:
meta_modcanon['author'].value_counts()
Out[52]:
author
Rilke, Rainer Maria       46
Heym, Georg               43
George, Stefan            16
Hofmannsthal, Hugo von     8
Name: count, dtype: int64

Ergänzungskorpus Münchhausen-Kreis¶

In [53]:
muench_authors = ['Münchhausen, Börries von', 'Miegel, Agnes', 'Strauß und Torney, Lulu von']
In [54]:
meta_muench = (
    meta
    .query("author in @muench_authors")
    .query("1850 <= year <= 1918")
    .query("geschichtslyrik == 1")
    .drop_duplicates(subset='author_title')
)
In [55]:
get_corpus_info(meta_muench)
Out[55]:
Anzahl
Texte 140
Digitalisierte Texte 140
Manuell datierte Texte 140
Autor:innen 3
Männliche Autor:innen 1
Texte von männlichen Autor:innen 94
Weibliche Autor:innen 2
Texte von weiblichen Autor:innen 46
In [56]:
meta_muench['author'].value_counts()
Out[56]:
author
Münchhausen, Börries von       94
Miegel, Agnes                  24
Strauß und Torney, Lulu von    22
Name: count, dtype: int64